﻿<!DOCTYPE html>
<html lang="zh-hans">
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <link type="image/x-icon" rel="shortcut icon" href="~/Images/icon/title.ico" />
    <meta charset="UTF-8">
    <title>@ViewBag.Title</title>
    <script src="~/Scripts/jquery-3.1.1.min.js"></script>
    <script src="~/Scripts/bootstrap.js"></script>
    <link href="~/Content/bootstrap.css" rel="stylesheet" />
    <script src="~/Scripts/Controls.js"></script>
    <script src="~/Scripts/layer.js"></script>
    <style>
        body {     
            padding-top: 50px;
        }

        .item img {
            width: 100%;
        }

        .navbar-inverse input[type="text"] {
            background: #313131;
            border: none;
            color: #999;
        }

        .navbar-inverse .navbar-form {
            position: relative;
        }

        .navbar-inverse button[type="button"] {
            position: absolute;
            top: 30%;
            right: 20px;
            background: none;
            border: none;
        }

        @@media(min-width:768px) {
            .navbar-inverse button[type="submit"] {
                top: 15%;
            }
        }

        .navbar-inverse .glyphicon {
            color: #999;
        }

        .profile {
            margin-right: 25px;
        }

        #copyright {
            background-color: #202020;
            height: 100px;
            color: #524f4f;
            text-align: center;
            font-size: 10px;
            padding-top: 6px;
        }
    </style>
    <script>
        $(function () {
            //注册事件
            $("#regist").click(function () {
                var data = { userName: $("#text_r").val(), email: $("#email_r").val(), passWord: $("#password_r").val() };
                ctrl.ajaxWebApi({
                    type: "post",
                    data: data,
                    url: "Api/User/UserRegist",
                    cache: false,
                    success: function (result)
                    {
                        ctrl.msg(result);
                        setTimeout(window.location.reload(), 2000);
                    }
                });
            });
            //登录事件
            $('#lgbtn').click(function () {
                var data = { email: $('#email').val(), password: $('#password').val() };
                ctrl.ajaxController({
                    type: "post",
                    data: data,
                    url: "/Shared/LoginView",
                    cache: false,
                    success: function (result) {
                        if (result.info == "登录成功！") {
                            localStorage.setItem("userinfo", result.Id);
                            ctrl.confirm('<span class="text- success">' + result.info + '</span>', callBack());
                        } else {
                            ctrl.msg(result.info);
                        }
                    }
                });
            });
        });
        function callBack() {
            
        }
    </script>
    @RenderSection("script", false)
    @RenderSection("css", false)
</head>
<body>
    <!--------------------------------- 导航开始 ------------------------------------->
    <nav class="navbar navbar-inverse navbar-fixed-top">
        <div class="container">
            <!-- 导航头 -->
            <div class="navbar-header">
                <button class="navbar-toggle" data-toggle="collapse" data-target="#myheader">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a href="#" class="navbar-brand"><strong>华仔</strong></a>
            </div>
            <!-- 主题内容 -->
            <div class="collapse navbar-collapse" id="myheader">
                <ul class="nav navbar-nav">
                    <li class="active"><a href="/Home/Index">首页</a></li>
                    <li><a href="/Content/Blog">博客</a></li>
                    <li><a href="/Content/Atricle">文章</a></li>
                </ul>
                <!-- 内嵌表单 -->
                <form action="" class="navbar-form navbar-left">
                    <input type="text" placeholder="搜索" class="form-control" />
                    <button type="button">
                        <span class="glyphicon glyphicon-search"></span>
                    </button>
                </form>
                <!-- 内嵌连接 -->
                <a href="#" class="btn btn-primary btn-sm navbar-btn navbar-right hidden-xs">订阅消息</a>
                <!-- 用户按钮 -->
                <div class="profile navbar-right">
                    <ul class="nav navbar-nav">
                        <li><a href="#" data-target="#login-modal" data-toggle="modal"><span class="glyphicon glyphicon-user"></span> 登录</a></li>
                        <li><a href="#" data-target="#regist-modal" data-toggle="modal"><span class="glyphicon glyphicon-log-in"></span> 注册</a></li>
                    </ul>
                    <!-- 使用Session -->
                    <p class="navbar-text">您好!
                    @{
                        if (Session["username"] != null)
                        {
                           @Html.ActionLink(Session["username"].ToString(), "Admin", "Home", new { Id = TempData["Id"] }, new { @class= "navbar-link" });
                        }
                        else
                        {
                            @Html.ActionLink(" ", "Admin", "Home",new { @class = "navbar-link" });
                        }
                    }
                    </p>
                    @*<a href="~/Home/Admin" class="navbar-link">@if (Session["username"] != null){@Session["username"].ToString();}</a>*@
                    <p class="navbar-text"><a href="~/Shared/Logout" class="navbar-link">退出</a></p>
                </div>
            </div>
            <!-- 需要折叠的内容 -->
        </div>
    </nav>
    <!--------------------------------- 导航结束 ------------------------------------->
    <!--------------------------------- 轮播开始 ------------------------------------->
    <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
        <!-- ol指示器  ol标签与ul标签不同 ol为是有序列表 ul为是无序列表 -->
        <ol class="carousel-indicators">
            <!-- 指示器 -->
            <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
            <li data-target="#carousel-example-generic" data-slide-to="1"></li>
            <li data-target="#carousel-example-generic" data-slide-to="2"></li>
        </ol>

        <!-- 包装的轮播图片-->
        <div class="carousel-inner" role="listbox">
            <!--图片-->
            <div class="item active">
                <img src="~/Images/1.jpg" alt="风景1">
                <div class="carousel-caption">
                    <!--h4中的内容显示到图片上面，-->
                    <h4>真正的才智是刚毅的志向。 —— 拿破仑</h4>
                </div>
            </div>
            <div class="item">
                <img src="~/Images/2.jpg" alt="风景3">
                <div class="carousel-caption">
                    <h4>志向和热爱是伟大行为的双翼。 —— 歌德</h4>
                </div>
            </div>
            <div class="item">
                <img src="~/Images/3.jpg" alt="风景4">
                <div class="carousel-caption">
                    <h4>生活有度，人生添寿。 —— 书摘</h4>
                </div>
            </div>
        </div>

        <!-- Controls -->
        <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
            <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
            <span class="sr-only">Previous</span>
        </a>
        <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
            <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
            <span class="sr-only">Next</span>
        </a>
    </div>
    <!--------------------------------- 轮播结束 ------------------------------------->
    <!--------------------------------- 子页内容 ------------------------------------->
    @RenderBody();
    <!--------------------------------- 子页内容 ------------------------------------->
    <!--------------------------------- 内容 ------------------------------------->
    <div class="container">
        <div class="row">
            <h2>图片预览</h2>
        </div>
        <div class="row">
            <div class="col-md-4">
                <img src="/Images/街景1.jpg" alt="" class="img-thumbnail" />
                <h4>街道景色</h4>
                <p>八境台坐落在江西省赣州市北八境公园内，章江和贡江在这里汇合，为省级重点风景名胜区。</p>
                <a href="#" class="btn btn-success col-md-offset-4">详情</a>
            </div>
            <div class="col-md-4">
                <img src="/Images/街景2.jpg" alt="" class="img-thumbnail" />
                <h4>街道景色</h4>
                <p>八境台坐落在江西省赣州市北八境公园内，章江和贡江在这里汇合，为省级重点风景名胜区。</p>
                <a href="#" class="btn btn-success col-md-offset-4">详情</a>
            </div>
            <div class="col-md-4">
                <img src="/Images/街景3.jpg" alt="" class="img-thumbnail" />
                <h4>街道景色</h4>
                <p>八境台坐落在江西省赣州市北八境公园内，章江和贡江在这里汇合，为省级重点风景名胜区。</p>
                <a href="#" class="btn btn-success col-md-offset-4">详情</a>
            </div>
        </div>       
    </div>
    <!--------------------------------- 结束 ------------------------------------->
    <!--------------------------------- 登录 ------------------------------------->
    <div class="container">
        <div class="modal fade" id="login-modal" tabindex="-1" data-backdrop="false">
            <div class="modal-dialog">
                <div class="modal-content">
                    <!-- 对话框头部 -->
                    <div class="modal-header">
                        <button class="close" data-dismiss="modal">&times;</button>
                        <h4>用户登录</h4>
                    </div>
                    <!-- 对话框内容 -->
                    <div class="modal-body">
                        <form class="form">
                            <div class="form-group">
                                <label for="email">Email</label>
                                <input type="email" class="form-control" id="email" placeholder="请输入email地址" />
                            </div>
                            <div class="form-group">
                                <label for="password">密码</label>
                                <input type="password" class="form-control" id="password" placeholder="请输入密码" />
                            </div>
                        </form>
                    </div>
                    <!-- 对话框底部 -->
                    <div class="modal-footer">
                        <button class="btn btn-primary" type="button" id="lgbtn">登录</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!--------------------------------- 结束 ------------------------------------->
    <!--------------------------------- 注册 ------------------------------------->
    <div class="container">
        <div class="modal fade" id="regist-modal" tabindex="-1" data-backdrop="false">
            <div class="modal-dialog">
                <div class="modal-content">
                    <!-- 对话框头部 -->
                    <div class="modal-header">
                        <button class="close" data-dismiss="modal">&times;</button>
                        <h4>用户注册</h4>
                    </div>
                    <!-- 对话框内容 -->
                    <div class="modal-body">
                        <form class="form">
                            <div class="form-group">
                                <label for="text_r">用户名</label>
                                <input type="text" class="form-control" name="userName" id="text_r" placeholder="请输入用户名" />
                            </div>
                            <div class="form-group">
                                <label for="email_r">Email</label>
                                <input type="email" class="form-control" name="email" id="email_r" placeholder="请输入email地址" />
                            </div>
                            <div class="form-group">
                                <label for="password_r">密码</label>
                                <input type="password" class="form-control" name="password" id="password_r" placeholder="请输入密码" />
                            </div>
                        </form>
                    </div>
                    <!-- 对话框底部 -->
                    <div class="modal-footer">
                        <button class="btn btn-primary" type="button" id="regist">注册</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!--------------------------------- 结束 ------------------------------------->
    <!--------------------------------- 页脚 ------------------------------------->
    <div class="container-fluid" id="copyright">
        <p style="margin-top:10px">2017@共享blogs  All Rights Reserved. </p>
        <p> 工信部备案号： 川ICP备16002450号-1 </p>
        <p> 联系方式：qq:847432003    邮箱：847432003@qq.com </p>
    </div>
    <!--------------------------------- 结束 ------------------------------------->
</body>
</html>
